package de.fhhannover.inform.hnefatafl.spiel;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Observable;

public class Logger extends Observable{
	
	public static FileWriter	fw;
	
	void writeToFile(String text){
		try{
			fw = new FileWriter("Hnefatafl.log", true);
			fw.append(text);		
			fw.append("\n");
			fw.close();
		}catch (IOException e) {
			e.printStackTrace();
		}		
	}
	
	void deleteFile(){
		try{
			fw = new FileWriter("Hnefatafl.log",false);
			fw.write("");
			fw.close();
		}catch(IOException e){
			e.printStackTrace();
		}
	}

}
